function [W age errors]=multiLayerNetwork(n, problem, activationFunc, hiddenLayerNeuronsParam, etha2)
    %valido la funcion de activacion y el problema a aprender
    if(n<2 || n >5)
        error('Amount of nodes must be a value between 2 and 5');
    end
    if(strcmp(problem,'parity') ~= 1 && strcmp(problem,'simetry') ~= 1)
        error('Problem must be ''parity'' or ''simetry''');
    end
    if(strcmp(activationFunc,'tanh') ~= 1 && strcmp(activationFunc,'linear') ~= 1 && strcmp(activationFunc,'step') ~= 1)
        error('Activation function must be ''step'' or ''linear'' or ''tanh''');
    end
    %n la cantidad de entradas, problem puede ser escalon/lineal/tanh
    table = makeTruthTable(n, problem);
    
    %table = makeTruthTableAnt(n, 'and');
    
    for i=1:2^n
        for j=1:n
            trainingSet(i,j) = table(i,j);
        end
        expectedOutput(i) = table(i,n+1);
    end
    
    expectedOutput = expectedOutput';
    [W age errors] = learn(activationFunc, trainingSet, expectedOutput, hiddenLayerNeuronsParam, etha2);
end